package com.leyou.trade.interval;

import com.leyou.trade.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class IntervalCloseOrder {

    final long refreshTime = 120000L;

    @Autowired
    private OrderService orderService;

    //2min周期查询一次，地址执行在整个spring的bean初始化过程中
    @Scheduled(fixedDelay = refreshTime)
    public void intervalInMintus() {

        this.orderService.closeOrder();
    }
}
